// 1. 引入模块
import Mock from "mockjs";
import axios from "axios";
// require或是ES6中的import 会将引入进来的json文件直接转换成真正的数组或对象
import banner from "./banner.json";
import floor from "./floor.json";

// 2. 配置服务
// Mock.mock(url,method,data)

Mock.mock("/mock/banner", "get", { code: 200, data: banner });
Mock.mock("/mock/floor", "get", { code: 200, data: floor });

//测试一下接口有没有用
// axios.get("/mock/banner").then(
//   (response) => {
//     console.log("mock", response);
//   },
//   (error) => {
//     console.log(error);
//   }
// );
